-
Notifications
You must be signed in to change notification settings - Fork 0
Fix: Annotation Option Checks Respect Entity Inheritance #454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Annotation Option Checks Respect Entity Inheritance #454
Conversation
…for property checks
…le entity annotations
…ips and PsiClass member access
…es from non-Entity parent classes as errors.
…rectly in the error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes annotation option validation in DAO parameters to properly respect Entity inheritance. The fix addresses an issue where properties defined in parent Entity classes were incorrectly flagged as errors when specified in include/exclude annotation options.
- Updated validation logic to use
allFieldsinstead offieldsto access inherited properties - Added filtering to only consider properties from Entity or Embeddable classes as valid options
- Enhanced test coverage with inheritance hierarchy test cases
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| DaoAnnotationOptionParameterCheckProcessor.kt | Core validation logic updated to handle inheritance and filter by Entity/Embeddable types |
| TypeUtil.kt | Minor cleanup removing redundant boolean comparison |
| PsiPatternUtil.kt | Variable declaration optimization |
| CLAUDE.md | Added guidance on using allFields/allMethods for inheritance support |
| .claude/guidelines/TEST_CASE_GUIDELINE.md | Enhanced test guidelines for Entity inheritance scenarios |
| Test entities | Added comprehensive Entity inheritance hierarchy test cases |
| Test DAOs | Added validation test cases for inherited properties |
| AnnotationOptionParameterInspectionTest.kt | New test class structure for manual validation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Problem
When specifying properties in the
include/excludeannotation options for a DAO parameter’s Entity class, properties defined in a parent class were incorrectly highlighted as errors.Relation
#453
Solution
allFields, allowing retrieval of properties defined in parent classes.Impact
This fix ensures that annotation option checks properly follow Entity inheritance, preventing false error highlights and improving accuracy when working with inherited properties.